package cn.itcast.session;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
public class shopDB {
    private static final Map<String, shop> cake = new LinkedHashMap<String, shop>();
    static {
        //cake.put("0", new Cake("0", "A类蛋糕"));
        cake.put("1", new shop("1", "牙刷",5.99));
        cake.put("2", new shop("2", "保温杯",19.99));
        cake.put("3", new shop("3", "插座",45));
        cake.put("4", new shop("4", "笔记本",3));
        cake.put("5", new shop("5", "中性笔",2));
        cake.put("6", new shop("6", "橡皮擦", 1.5));
        cake.put("7", new shop("7", "铅笔", 0.99));
        cake.put("8", new shop("8", "书包", 49.99));
        cake.put("9", new shop("9", "计算器", 12.99));
        cake.put("10", new shop("10", "文件夹", 3.99));
        cake.put("11", new shop("11", "订书机", 15.99));
        cake.put("12", new shop("12", "马克笔", 2.99));
        cake.put("13", new shop("13", "A4纸", 8.99));
        cake.put("14", new shop("14", "便签纸", 2.49));
        cake.put("15", new shop("15", "剪刀", 5.99));
    }
    // 获得所有的蛋糕
    public static Collection<shop> getAll() {
        return cake.values();
    }
    //根据 id 指定的获取蛋糕
    public static shop getCake(String id) {
        return cake.get(id);
    }

}
